<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>无标题文档</title>
</head>

<body>
<script>
	document.write('<p>直角三角形</p>');
	for(var i=1;i<=4;i++){
    	for(j=1;j<=i;j++){
        	document.write('*');
    	}
    	document.write('<br>')
	}
	
	document.write('<p>等边三角形</p>');

	for(var i=1;i<=4;i++){
		for(k=1;k<=4-i;k++){
			document.write("&nbsp;");
				}
    	for(j=1;j<=2*i-1;j++){
        	document.write('*');
    	}
    	document.write('<br>')
	}

</script>
</body>
</html>